package com.jkoss.biz.imp.jy;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.jkoss.biz.jy.StucmpjobBiz;
import com.jkoss.dao.jy.StucmpjobMapper;
import com.jkoss.pojo.jy.Stucmpjob;
import com.jkoss.tool.Page;
@Component
public class StucmpjobBizImpl implements StucmpjobBiz{
    
	@Autowired
	private StucmpjobMapper scjDao;
	
	@Override
	public List<Stucmpjob> listPageGw(Page<Stucmpjob> page) {
		
		return scjDao.listPageGw(page);
	}

	@Override
	public Stucmpjob findByGwId(Integer jygwid) {
		
		return scjDao.findByGwId(jygwid);
	}

	@Override
	@Transactional
	public String addGw(Stucmpjob gw) {
		
		return scjDao.insert(gw)>0?"添加成功":"添加失败";
	}

	@Override
	@Transactional
	public String delGw(Integer jygwid) {
		// TODO Auto-generated method stub
		return scjDao.deleteByPrimaryKey(jygwid)>0?"删除成功":"删除失败";
	}

	@Override
	@Transactional
	public String upGw(Stucmpjob gw) {
		
		return scjDao.updateByPrimaryKey(gw)>0?"更新成功":"更新失败";
	}

	@Override
	public List<Stucmpjob> listGwAndCp() {
		// TODO Auto-generated method stub
		return scjDao.listGwAndCp();
	}
    
}
